var AttendanceStat = function (attendance, abnormalAttendance) {
  BaseModel.call(this);
  var self = this;

  var fn = {
    initData: function (attendance, abnormalAttendance) {
      var fields = ['leaveTimesMaximumPerson', 'leaveDurationMaximumPerson', 'fillcardTimesMaximumPerson', 'lateTimesMaximumPerson',
        'lateDurationMaximumPerson', 'earlyTimesMaximumPerson', 'earlyDurationMaximumPerson'
      ];
      self.setDataFromObj(attendance, fields);

      var abnormalAttendanceData = _.map(abnormalAttendance, function (obj) {
        var workshopName = obj.workshopName;
        if (workshopName === null) {
          workshopName = '';
        }
        return {
          deptName: obj.deptName,
          workshopName: workshopName,
          userName: obj.userName
        }
      });
      self.abnormalAttendanceData = abnormalAttendanceData;
    }
  };

  fn.initData(attendance, abnormalAttendance);
};